
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	
	<form action="/forgotPwd" method="post">
	<input id="username" type="text" placeholder="请输入用户名" name="username" maxlength="200" onblur="checkUserName()"/>
                <span id="span1"></span><br/> 
    <input type="text" name="email" placeholder="邮箱"/><br/> 
    <input type="submit" value="找回"/> 
<!-- 		<input name="username" placeholder="email/用户"/><br/> -->
<!-- 		<input type="text" name="email" placeholder="邮箱"/><br/> -->
<!-- 		<input type="submit" value="找回"/> -->
	</form>
	<a href="/hello?id=5"></a>
	
	
	
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
	
	submitForm();
})

function checkUserName(){
	$.ajax({
		type : "GET",
		url : "/check",
		dataType : "json",
		contentType : "application/json",
		data :{username:$("#username").val()},
		success : function(result){
			if(result==1){
				$("#span1").html("<font color='green'>该用户名不存在</font>");
			}else if(result == -1){
				$("#span1").html("<font color='red'>用户名不能为空</font>");
				
			}else{
				$("#span1").html("<font color='green'>该用户名有效</font>");
			}
		}
})
}







</script>
</body>
</html>